<template>
  <div id="app">
    <Header />

    <router-view v-if="isShow"></router-view>

    <Footer />
  </div>
</template>

<script>



//引入Header,Footer普通组件
import Header from './components/Header';
import Footer from './components/Footer'
//引入请求函数,调用请求函数获取数据 待定

export default {
  name: "App",
  provide() {
    //父组件中通过provide提供变量,在子组件中提供inject接收
    return {
      reload: this.reload
    }
  },
  data() {
    return {
      isShow: true
    }
  },

  components: {
    Header,
    Footer,

  },
  methods: {
    reload() {
      this.isShow = false
      this.$nextTick(function () {
        this.isShow = true
      })
    }
  },
}
</script>

<style lang="scss">
#app {
  overflow: hidden;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
